package com.lucenly.spell.view.dialog

import android.app.Dialog
import android.content.Context
import android.view.Gravity
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView
import com.lucenly.spell.R
import com.moregold.mvvmlib.ext.ext_doubleClick

class PayResultDialog(context:Context) : Dialog(context, R.style.DialogStyle){

    init {
        val view = layoutInflater.inflate(R.layout.dialog_pay_result,null)
        setContentView(view)
        setCanceledOnTouchOutside(false)
        val tvSure = view.findViewById<TextView>(R.id.tvSure)
        tvSure.ext_doubleClick {
            dismiss()
        }
        val window = window
        if (window != null) {
            val params = window.attributes
            params.width = LinearLayout.LayoutParams.MATCH_PARENT
            params.height = LinearLayout.LayoutParams.WRAP_CONTENT
            params.gravity = Gravity.CENTER
            window.attributes = params
        }
    }
}